module CaMenuHelper

def select_criar_item(ca_menu_id)
  ret = "<select name='ca_menu_item[parent_id]'>"
  ret << "<option value=0 selected>-- escolha o item pai --</option>"
  CaMenuItem.find(:all,:conditions=>"ca_menu_id=#{ca_menu_id}",:order=>"lft").each do |ca_menu_item|
    ret << "<option value='#{ca_menu_item.id}'>"<<'->'*ca_menu_item.level<<"#{ca_menu_item.nome}</option>"
  end
  ret << "</select>"
  ret
end

end